cmake_minimum_required(VERSION 2.6)
  PROJECT(OgreMHX)
 
  set(CMAKE_MODULE_PATH 
 	"${CMAKE_SOURCE_DIR}/CMake"
  )
  
  FIND_PACKAGE(OGRE)
  FIND_PACKAGE(OIS)
  
  INCLUDE_DIRECTORIES(
 	${OGRE_INCLUDE_DIRS}
 	${OIS_INCLUDE_DIRS}
 	${PROJECT_SOURCE_DIR}
  )
    
  FILE(GLOB SRCS MHXViewer/*.cpp)
  FILE(GLOB HDRS MHXViewer/*.h)
 
  ADD_EXECUTABLE(MHXViewer WIN32
 	${SRCS}
 	${HDRS}
  )
 
  TARGET_LINK_LIBRARIES(MHXViewer
 	${OIS_LIBRARIES}
 	${OGRE_LIBRARIES}
 	OgreMHX
  )
  
  ADD_CUSTOM_COMMAND(
    TARGET MHXViewer
    POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy
    ${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/MHXViewer${CMAKE_EXECUTABLE_SUFFIX}
    ${PROJECT_SOURCE_DIR}/bin/MHXViewer_${CMAKE_CFG_INTDIR}${CMAKE_EXECUTABLE_SUFFIX}
  )
  
  FILE(GLOB SRCS OgreMHX/*.cpp)
  FILE(GLOB HDRS OgreMHX/*.h)
  ADD_LIBRARY(OgreMHX ${SRCS} ${HDRS})

  ADD_DEPENDENCIES(MHXViewer OgreMHX)